package com.ruoyi.project.system.domain;

import java.math.BigDecimal;

import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import com.ruoyi.framework.web.domain.BaseEntity;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

@Accessors(chain = true)
public class SysUserProductPrice extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 定价id
     */
    private Long id;

    /**
     * 用户id
     */
    @Excel(name = "用户id")
    private Long userId;

    /**
     * 产品id
     */
    @Excel(name = "产品id")
    private Integer productId;

    /**
     * 产品底价
     */
    @Excel(name = "产品底价")
    private BigDecimal customizedPrice;

    /**
     * 上级代理提成额度
     */
    @Excel(name = "上级代理提成额度")
    private BigDecimal royalty;

    /**
     * 对下级最大提成
     */
    @Excel(name = "对下级最大提成")
    private BigDecimal maxRoyalty;

    /**
     * 用户收益
     */
    @Excel(name = "用户佣金")
    private BigDecimal brokerage;

    /**
     * 对下级最大提成
     */
    @Excel(name = "对下级最大佣金")
    private BigDecimal maxBrokerage;

    /**
     * 产品定价状态（0正常；1停用）
     */
    @Excel(name = "产品定价状态", readConverterExp = "0=正常；1停用")
    private String status;

    public void setProductId(Integer productId) {
        this.productId = productId;
    }

    public BigDecimal getMaxRoyalty() {
        return maxRoyalty;
    }

    public void setMaxRoyalty(BigDecimal maxRoyalty) {
        this.maxRoyalty = maxRoyalty;
    }

    public BigDecimal getMaxBrokerage() {
        return maxBrokerage;
    }

    public void setMaxBrokerage(BigDecimal maxBrokerage) {
        this.maxBrokerage = maxBrokerage;
    }

    /**
     * 删除标志（0代表存在；2代表删除）
     */
    private String delFlag;

    public SysUserProductPrice() {
    }

    public SysUserProductPrice(Long userId) {
        this.userId = userId;
    }

    public SysUserProductPrice(Long userId, SysProduct sp, BigDecimal price) {
        super();
        this.userId = userId;
        this.productId = sp.getProductId();
        this.royalty = sp.getRoyalty();
        this.brokerage = sp.getBrokerage();
        this.customizedPrice = price;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setProductId(int productId) {
        this.productId = productId;
    }

    public Integer getProductId() {
        return productId;
    }

    public BigDecimal getCustomizedPrice() {
        return customizedPrice;
    }

    public void setCustomizedPrice(BigDecimal customizedPrice) {
        this.customizedPrice = customizedPrice;
    }

    public BigDecimal getRoyalty() {
        return royalty;
    }

    public void setRoyalty(BigDecimal royalty) {
        this.royalty = royalty;
    }

    public BigDecimal getBrokerage() {
        return brokerage;
    }

    public void setBrokerage(BigDecimal brokerage) {
        this.brokerage = brokerage;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getStatus() {
        return status;
    }

    public void setDelFlag(String delFlag) {
        this.delFlag = delFlag;
    }

    public String getDelFlag() {
        return delFlag;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("userId", getUserId())
                .append("productId", getProductId())
                .append("customizedPrice", getCustomizedPrice())
                .append("royalty", getRoyalty())
                .append("brokerage", getBrokerage())
                .append("status", getStatus())
                .append("delFlag", getDelFlag())
                .append("createTime", getCreateTime())
                .append("updateTime", getUpdateTime())
                .append("remark", getRemark())
                .toString();
    }
}
